/*
 * @Author: 火红色祥云 201926154@qq.com
 * @Date: 2025-02-03 11:25:44
 * @LastEditors: 火红色祥云 201926154@qq.com
 * @LastEditTime: 2025-02-23 16:22:40
 * @FilePath: \Project_ESP32C3\src\main.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#if 1
#include "i2c/i2c.h"
#include "master_spi/master_spi.h"
#include "./led/led.h"
#include "./uart/uart.h"

void setup() {
    led_init();
    uart_init(115200);
}

void loop() {
    led_off();
    serial_print("close");
    delay(1000);
    led_on();
    serial_print("open");
    delay(500);
}
#endif

#if 0
I2CComm i2cComm(0x65); // 创建 I2CComm 对象，传入设备地址
SPIComm spiComm(SS);

void setup() {
    i2cComm.begin();
}

void loop() {
    static uint8_t counter = 0;
    uint8_t data[4] = {
        0xAA,             // 同步头
        0xAA,          // 计数器
        0x55,// 反码校验
        0x55              // 结束符
    };
    i2cComm.sendData(data, sizeof(data));
    counter++;
    delay(100);  // 1秒间隔方便观察
}
#endif